package model;

import java.io.Serializable;

/**
 * 消息对象，用于在网络中传输发送的聊天消息，包括消息内容，发送人，收信人
 * 如果to为null,则为公共消息
 */
public class Message implements Serializable{
	private String content;
	private String from;
	private String to;
	
	public Message(String content,String from,String to){
		this.content=content;
		this.from=from;
		this.to=to;
	}
	
	//判断该消息是否为共有消息
	public boolean isCommon(){
		if(to==null){
			return true;
		}
		return false;
	}
	
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public String getFrom() {
		return from;
	}
	public void setFrom(String from) {
		this.from = from;
	}
	public String getTo() {
		return to;
	}
	public void setTo(String to) {
		this.to = to;
	}
	
}
